﻿@using GTAuto.DAL.DAL
@model GTAuto.DAL.Entities.GTFirmCategory
@{
    ViewBag.Title = "BrandEdit";
    Layout = "~/Views/Shared/_Layout.cshtml";
    List<string> err = ViewBag.Errs;
}
<h4 class="alert_info">
    @if (Model.Id > 0)
    {
        <div>
            Редактирование категории</div>
    }
    else
    {
  
        <div>
            Создание новой категории</div>
    }
</h4>
@using (Html.BeginForm("FirmCategoryEdit", "Firms", FormMethod.Post, new { @class = "jNice", enctype = "multipart/form-data" }))
{

    if (err != null && err.Count != 0)
    {

        foreach (var er in err)
        {

    <h4 class="alert_error">
        @er</h4>

        }
    }
    if (ViewBag.Succes != null)
    {
    <h4 class="alert_success">
        @ViewBag.Succes</h4>
    }

    <article class="module width_full">
        <header><h3>Данные о категории</h3></header>
        <div class="module_content">
            <fieldset>
                <label>Название</label>
                <input type="text" id="Name" name="Name" value="@Model.Name" />
            </fieldset>
            <fieldset style="width: 100%; float: left; margin-right: 3%;">
                 <label>
                    Аткивная категория :</label>@Html.CheckBox("Active", Model.Active)
            </fieldset>
            <fieldset style="width: 100%; float: left; margin-right: 3%;">
                 <label>
                    Лого(круп.) :</label><input type="file"  id="Logo" name="Logo" value="@Model.Logo" />
            </fieldset>
           
            @if (!string.IsNullOrEmpty(Model.Logo))
            {
                 <p>
                     <img src="@string.Format("{0}/{1}", DALSettngs.Singleton.Get("BrendLogosAdminView").Value, Model.Logo)"/>
                 </p>
            }
            <div class="clear"></div>
        </div>
        <footer>
            <div class="submit_link">
               
                <input type="submit" value="Сохранить" class="alt_btn">
               
            </div>
        </footer>
    </article>
}
<!-- end of post new article -->
<div class="spacer">
</div>
